package com.yunhe.authority.controller.company;

import com.yunhe.authority.domain.company.ProjectCompanyTree;
import com.yunhe.authority.service.company.CompanyTreeService;
import com.yunhe.common.model.ResultObject;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "companyTree",description = "企业树形维护", tags = {"Model_CompanyTree"})
@RequestMapping("/companyTree")
@RestController
public class CompanyTreeController {

    @Autowired
    private CompanyTreeService companyTreeService;

    @ApiOperation("获得企业树形")
    @RequestMapping(method = RequestMethod.GET)
    public ResultObject<ProjectCompanyTree> getTree(@ApiParam(value = "type",required = false) @RequestParam(value = "type",required = false) String type) {
        ProjectCompanyTree companyTree = companyTreeService.getTree(type);
        return new ResultObject<ProjectCompanyTree>(companyTree);
    }
}
